package com.tiger.log.server.mapper;

import com.tiger.log.common.entity.SysRecordLog;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @ClassName SysRecordLogMapper
 * @Description TODO
 * @Author huxuehao
 **/
@Repository
public interface SysRecordLogMapper {
    List<SysRecordLog> selectAll();

    SysRecordLog selectById(@Param("id") String id);

    List<SysRecordLog> selectByBusinessId(@Param("businessId") String businessId);

    List<SysRecordLog> selectByClassify(@Param("classify") String classify);

    List<SysRecordLog> selectByCode(@Param("code") String code);

    int add(@Param("recordLog") SysRecordLog recordLog);

    int deleteAll();

    int deleteByIds(@Param("ids") List<String> ids);

    int deleteByBusinessIds(@Param("businessIds") List<String> businessIds);
    int deleteByClassifies(@Param("classifies") List<String> classifies);

    /* 查询日志表中日周期 */
    String selectDayCycle();

    /* 复制表，实现日志轮转 */
    int copyTable(@Param("tableName_n") String tableName_n);

    /* 如果存在tableName_n表，则清空日志表的日志 */
    int delRecordsIFExist(@Param("tableName_n") String tableName_n);
}
